package com.sigerap.mesa.service;

import java.util.List;

import javax.persistence.EntityManager;

import com.sigerap.comanda.model.Comanda;
import com.sigerap.common.util.Utilitario;
import com.sigerap.mesa.model.Mesa;
import com.sigerap.mesa.model.dao.MesaDAO;
import com.sigerap.mesa.model.dao.jpa.JPAMesaDAO;

/**
 * 
 * @author Spirit-20121
 *
 */
public class MesaService {
	
	private MesaDAO mesaDAO;
	private EntityManager em;
	
	public MesaService(){
		em = Utilitario.getInstance().getEntityManager();
		mesaDAO=new JPAMesaDAO(em);
	}

	public List<Mesa> listarMesas() {
		// TODO Auto-generated method stub
		return mesaDAO.findAll(); 
	}

	public Comanda buscarComandaByMesa(Mesa m) {
		// TODO Auto-generated method stub
		return mesaDAO.findByMesa(m); 
	}

}
